<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .text-center {
            width: 100%;
            text-align: center;
        }

        .red {
            color: red;
        }
    </style>
</head>
<body>
<div id="app" class="text-center">
    <Test></Test>
    <demo></demo>
    <Test1 msg="呵呵呵呵呵"></Test1>
    <Test1 :msg="bingMsg"></Test1>
    <Test1 v-for="i in msgs" :msg="i"></Test1>
    <h1 v-test="n"></h1>
</div>

<script src="../frm/vue.js"></script>

<script>
    Vue.component('Test',{
       template:"<h1>自定义全局组件</h1>"
    });
    Vue.component('Test1',{
       template:"<h1>自定义全局组件{{msg}}</h1>",
        // props:['msg'],
        props:{
           msg:String
        }
    });

    let app = new Vue({
        el: "#app",
        data: {
            bingMsg:"Hello Demo",
            msgs:['C++',"Java","Kotlin"],
            n:99
        },
        methods: {//这里的this 仍然是 vue实例

        },
        computed: {

        },
        filters: {

        },
        watch:{

        },
        components:{
            demo:{
                template: "<h1>自定义局部组件</h1>"
            }
        },
        directives:{
            test(el,binding){
                console.log(el,binding);
                el.innerHTML = binding.value * 10;
            }
        }

    });



</script>

</body>
</html>
